Skip to content

feat(i18n): the sign-in page and the in-app language menu offer one list, every interface language - #36040

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-2egdok
Nov 21, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-2egdok

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

repo:objectstack#1 · os-sales · session_01L6bhgTB7jMdUGcVwaMo3CH

Fixes #35425

Part of epic #34571 (area b1-CX). Maintainer ruling 7056785432, option A: 「两处都列全部 11 种」. Flow: dev-thread rule (the card thread builds itself; L1 at L1-a, the seat runs the declaration L2).

What changes

  • @object-ui/i18n provider. offerableLanguages is now every platform locale table language (11 today), whatever the app ships, and never null. A new context field, appContentLanguages, carries the table languages the app's own /api/v1/i18n/locales list covers, or null when not known (in flight, no loadLocales wiring, signed out, a failed read, or an answer naming no table language). The provisional self-heal still judges a stored value against the table, so an out-of-table code (th) is still reverted and purged.
  • LocaleSwitcher (the sign-in page footer and the account menu are this one component) lists all 11. When the app list is known and leaves a language out, that row carries one muted line: console.localeSwitcher.appContentDefault, "App content shows in the default language" / 「应用内容显示为默认语言」 (says "default language", not "English", per the ruling). Signed out nothing is read about the app, so the sign-in page lists the 11 with no line. The menu's width is bounded (max-w-[min(20rem,calc(100vw-2rem))]) so a long hint wraps.
  • Profile page language card offers the same 11 and shows the same line under the picker when the chosen language is outside appContentLanguages (never for "Use the deployment default", never for a stored out-of-table tag).
  • New locale key console.localeSwitcher.appContentDefault in the ten hand-written packs; zh-Hant regenerated with gen:zh-hant.
  • Not changed: GET /api/v1/i18n/locales, the language packs, the organisation default-language setting (it does not read offerableLanguages).

Why

The account menu offered the platform table ∩ the app's declared locales (four on HotCRM), while the sign-in page, which has no session to ask the app with, offered all eleven. A language picked on the sign-in page (German, Korean) was then missing from the menu after sign-in. The ruling loosens ruling F of #29349 (implemented by #30514): one list everywhere, and the menu hint F rejected is now wanted.

Verification

Acceptance notes (behaviour this PR does not change):

Clause-②: yes (widening)
Metadata-protocol: none

@object-ui/i18n adds appContentLanguages to the i18n context and the locale key console.localeSwitcher.appContentDefault; offerableLanguages loses | null (an output that is never null now); nothing removed.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

Generated by Claude Code

Both now list every platform locale table language; the app's own locale
list only decides which rows carry "App content shows in the default
language". The profile page's language card reads the same list and shows
the same line for a chosen language the app does not ship.

Claude-Session: https://claude.ai/code/session_01L6bhgTB7jMdUGcVwaMo3CH
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 21, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Posted 2026-11-21T10:43Z. The brief handed to the isolated declaration-face reviewer for PR #36040 (owed by the changeset's Clause-②: yes (widening) line). The record follows as its own comment.

Contract review brief — PR #36040 @ 59b07447d1fe925c7f8baf39ebd7c3bfb77d6718 (card #35425)

You review at TIER_DEFAULT. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template --face declaration — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #35425: its body and EVERY comment (rulings and earlier records included)
· PR #36040: its body, its file list, and the net diff against main at 59b07447d1fe925c7f8baf39ebd7c3bfb77d6718
· the check-runs on 59b07447d1fe925c7f8baf39ebd7c3bfb77d6718: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-user/3d3cbaf6-4903-5fed-92d4-c2b94a45e868/scratchpad/pr-36040/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U

席位核对 — ACCEPT (L1-a)

维护者速读

这个 PR 按裁决 A 做:登录页、头像菜单里的语言菜单、个人资料页的语言卡,三处都列出全部 11 种界面语言。应用自己的内容(对象、字段、视图名称)没有翻译的语言照样能选,只在那一行下面加一行小字「应用内容显示为默认语言」。登录页还没有读过应用信息,所以不加小字。在登录页选了德语的人,登录后菜单里仍能看到德语,并且德语仍是勾选状态。

我核过以下几点:

  • 语言清单现在只有一份,三处读的是同一个来源。
  • 小字只在确实知道应用不带这种语言时出现。还没读到应用信息时一律不标。
  • 11 个语言包都加了这句小字,简体中文的措辞和裁决原文一致。
  • 原来的保护仍然有效:存了平台不支持的语言(如泰语)时,仍会被撤回。
  • 不属于受管面,按普通队列合并。因为声明了对外接口有新增,座位还要在同一版本上跑一次 L2,本记录不替代它。

没有需要修的问题。下面记了一个小问题和一个行为变化,供知悉。座位已裁定的两条观察(已存语言优先、手机德语头像菜单超宽 #36041)我核对过证据,属实,确实不在本 PR 内。

Head reviewed: 59b07447d1fe925c7f8baf39ebd7c3bfb77d6718. Two commits, 22 files, +385/−197. git merge-tree onto current main is clean. check-governed-merges --pr 36040 (PR-head register) reads NOT governed, 0 of 22 paths. reviewFace with Clause-②: yes (widening) gives face declaration → TIER_DEFAULT, so the seat's declaration L2 on this head is the review that face owes; this record does not replace it. CI is as the thread reported. vitest was not run here (no node_modules).

What holds

  • One list. offerableLanguages is now the constant BUILT_IN_LANGUAGE_CODES. It has a stable identity, so effects keyed on it do not re-run. Its consumers are LocaleSwitcher, the profile LanguageCard and useSignedInUserLocale. The first two are changed here, and the third is covered below. LocaleSwitcher is the one component in both places: the sign-in page renders it from AuthFooter.tsx, and the account menu renders it from AppHeader.tsx:1458. No other reader of the old table ∩ app set exists in ui/, and none exists in hotcrm.
  • appContentLanguages. It is offeredTableTags(appLocales), which is exactly the set the old offerableLanguages computed. The difference is that "not known" now reads null everywhere, where it used to fall back to the full table: no loader, in flight, [], or no table language. The switcher and the card both test !== null before marking, so an unknown list marks no row, as the ruling's "signed out marks nothing" requires.
  • Self-heal unchanged in effect. bootstrap.provisional is set only for a stored value that is not statically known (isStaticallyKnownLanguage), so it is never a table tag. Judging it against the table instead of table ∩ app therefore reverts the same values as before. th is still reverted and purged. The removed !offerableLanguages guard was the in-flight null, which no longer exists.
  • Profile card.
    • choiceInDefault requires offerableLanguages.includes(choice). That keeps the hint off "Use the deployment default" and off a prepended out-of-table stored tag.
    • Removing the early return null for in-flight is right, because there is no in-flight state any more.
    • The three new cases pin the three branches.
  • Menu width. I probed tailwind-merge 3.7.1 on the exact strings. max-w-[min(20rem,calc(100vw-2rem))] survives the base min-w-[8rem], and the item's gap-2 merges with no loss. The base max-h-[var(--radix-dropdown-menu-content-available-height)] was already overridden by max-h-72 on main, so that is not new here.
  • Strings. The key is in all eleven packs. zh-Hans reads 「应用内容显示为默认语言」, the ruling's wording, and says "default language", not "English". zh-Hant is a one-line regenerated diff.
  • Clause-② yes (widening) is right.
    • The context gains a field.
    • offerableLanguages drops | null on an output, so every existing reader still type-checks.
    • The context object is not exported, so nobody outside constructs an I18nContextValue.
    • Nothing is removed.
    • The changeset carries both declaration lines.
  • Evidence. I read build-seat1/35425/. The 375 German account-menu shot (after-375-03) shows the language list opening off the right edge, because the avatar menu itself is wider than the screen. That matches the seat's Phone: in German the avatar menu is wider than the screen and pushes the language submenu off it #36041 reading: the bounded width is applied, but the trigger is off-screen.

Nit (does not block)

  • N1: the doc comment in useUserLocale.ts:372-403 is now stale. It describes offerable as "the deployment's published locales ∩ what this renderer can resolve", and it describes a null "while the list is still in flight" that the provider no longer produces. The offerableKey === null branch in useSignedInUserLocale is now dead too. If a push happens for other reasons, a one-paragraph refresh would do; it is not worth a push on its own.

Observation (no change asked)

  • A saved column now applies for more languages. useSignedInUserLocale resolves sys_user.locale against offerableLanguages. Before this PR, a saved de on an app that ships only en + zh-CN was not applied after sign-in, and the device language kept rendering. It is now applied, and immediately, with no wait for the app list. This follows directly from ruling A, since de is now an offered language. Neither the body nor the changeset says it, though, and no test here pins it; the hook tests mock the list. This is the same behaviour the seat's "saved language wins over the sign-in pick" observation (Sign-in page: a language picked before signing in is not saved as the person's own preference when they have none (save after #30157) #30399) relies on.

Landing terms

  • Not governed. After the seat's declaration L2 on this head, it lands through the ordinary queue, and Fixes #35425 closes the card on merge.
  • A new push needs a delta L1 unless it is a clean main merge.
  • This review does not approve, mark ready, enqueue or request review.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 59b07447d1fe925c7f8baf39ebd7c3bfb77d6718
Local-runs: none

Face: declaration (Clause-②: yes (widening) on the PR body and the changeset). No published schema (packages/spec/src/**) and no governed path in the file list, so no Scope: line and no ④. Inputs read: card #35425 body and all three comments (triage 7005602618, maintainer ruling 7056785432, claim 7060793714); PR #36040 body, its 22-file list and the net diff against main (merge-base fe753492ff); the check-runs on this head. Code outside the diff (useUserLocale.ts, loadLocales.ts, i18nSession.ts, locales/index.ts, index.ts) was read, not reviewed.

Gate verdicts (check-runs on the head): every run concluded success or skipped, none failed and none pending. Among them: Type Check UI, TypeScript Type Check, Test UI (16/16 shards), Lint UI, Lint · ESLint, Lint · repo & tooling gates, Check Changeset, PR-body guards, Governed Surface Queue Guard, Build & E2E UI, Live E2E UI, Dogfood Regression Gate.

① Derived judgments

Public-surface changes of @object-ui/i18n (entry ., reached through useObjectTranslation() / useI18nContext()):

  • offerableLanguages value: table ∩ app list → every platform locale table language. Right. It is ruling 7056785432 option A verbatim (both places list all 11; the profile card uses the same list). Constant BUILT_IN_LANGUAGE_CODES, so the identity stays stable for dep arrays; the order is now the table's, not the app's, which no consumer in ui/ depends on.
  • offerableLanguages type: readonly string[] | null → readonly string[]. Right, a widening. It is an output only: the context object is not exported, so no outside code constructs an I18nContextValue, and a reader's === null guard type-checks and goes dead (Type Check UI green). The two in-diff consumers drop their null branches (LocaleSwitcher no longer renders nothing in flight; LanguageCard no longer hides itself).
  • New appContentLanguages: readonly string[] | null. Right. offeredTableTags(appLocales) (table tags, de-duplicated, app order) or null for not wired, in flight, [] (signed out or failed read: loadLocales.ts answers [] signed out) and an answer naming no table language. "Not known marks nothing" is what the ruling's hint needs: a hint is never claimed without a read. Outside a provider it is null.
  • Self-heal (provisional) now judged against the table, not table ∩ app. Right. A provisional language is one not statically known, so it is never a table tag. th is still reverted and purged, and a stored de the app does not ship is now kept, which the ruling requires. The guard appLocales.length === 0 keeps a failed or signed-out answer from reverting anything, as before.
  • Consequence outside the diff, useSignedInUserLocale (useUserLocale.ts). Right. pickRenderableLocale(column, offerable) now resolves against the 11, so a saved sys_user.locale = de on a four-language app is applied where it used to be skipped, and it is no longer held back while the app list is in flight. Both follow from the ruling ("stays selectable; the interface chrome shows in that language").
  • New pack key console.localeSwitcher.appContentDefault in all eleven packs (zh-Hant generated). Right. Wording says "default language", not "English", per the ruling. TranslationKeys (typeof en) gains one leaf, which is how every added key in this package has shipped.
  • LocaleSwitcher (sign-in footer and in-app menu, one component): lists offerableLanguages, adds the muted hint per row exactly when appContentLanguages is known and leaves that tag out; tags are compared as table tags on both sides. Right. The width bound max-w-[min(20rem,calc(100vw-2rem))] only constrains the language menu.
  • ProfilePage LanguageCard: the same list; the hint under the picker only for an offered choice outside a known appContentLanguages. It is never shown for "Use the deployment default" or a stored out-of-table tag. Right. The organisation default-language setting does not read offerableLanguages (grep of ui/ at head: the only readers are LocaleSwitcher, LanguageCard and useUserLocale), so it keeps the app's declared list as the ruling says.
  • Post-sign-in freshness. The provider asks loadLocales once per page load and signed out it answers []. That holds because every console sign-in exit is a full-page navigation (i18nSession.ts header; authExitBasename.test.tsx pins it), so the signed-in boot asks again and the hints appear after sign-in.
  • Not changed, as the card's 不做的 says: GET /api/v1/i18n/locales, the set of packs, I18nProviderProps.
  • Tests: the removed intersection pins are replaced by their inverse (11 rows, exactly 7 hints on a four-language app, no hint while unknown, th never offered, stored de kept, stored th reverted). The deleted regional-label case is still covered by the table-label rows (localeLabel(row.tag)). No coverage was lost that the new contract still owns.

Findings:

  • nit: ui/packages/app-shell/src/hooks/useUserLocale.ts (outside the diff; the claim named it "maybe comments only"). The offerableKey null arm and the pickRenderableLocale doc line "null while the list is still in flight" no longer describe any provider path. Behaviour is correct, but the comment is stale.
  • nit: ui/packages/i18n/src/provider.tsx. The appLocales state comment ("both degrade to the offline fallback below") and the loadLocales prop jsdoc ("Without this prop the switcher offers the platform locale table's tags") predate the change. The prop now feeds only appContentLanguages and the self-heal, and the switcher offers the table with or without it.
  • nit: ui/packages/app-shell/src/layout/LocaleSwitcher.tsx. The hint sits inside the menuitem, so it joins the item's accessible name ("Deutsch App-Inhalte erscheinen …"). An aria-describedby would keep the name to the language. This is not a correctness issue.

No must-fix, no should-fix.

② Semver level

  • Changeset .changeset/35425-one-language-list.md: @object-ui/i18n patch, @object-ui/app-shell patch, @object-ui/console patch. That matches what the diff moves: i18n (provider and packs), app-shell (LocaleSwitcher; private, but versioned under privatePackages.version: true, with precedent on main) and console (ProfilePage). i18n and console are in the fixed group.
  • Metadata-protocol: none: correct. Nothing a metadata author can write changes. By AGENTS.md Post-Task Checklist 3, a non-protocol change ships patch, so patch is the right level, not minor.
  • Clause-②: yes (widening): correct, no narrowing arm owed. It adds one context field and one pack key, and drops null from an output-only field. The offered list grows, nothing is removed or renamed, and no BREAKING banner or ADR-0087 disposition is owed. Both declaration lines are line-initial in the PR body and the changeset body (Check Changeset and PR-body guards green). The changeset prose agrees with the diff.

③ Boundary flags

Implemented-by: claude/project-thread-2egdok
Reviewed-by: session_01L6bhgUkbQqRUUFSiu2HGob (isolated L2 sub-agent of the seat)

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Seat landing · 2026-11-21T10:49Z · The b1-CX thread 5 PR for #35425: the avatar menu, the sign-in page and the profile page's language card offer the same list, all 11 interface languages (the maintainer's ruling 7056785432, option A). When the app's own list is known and does not cover a language, its row says 「应用内容显示为默认语言」. Signed out, the app list is unknown, so the sign-in page lists the 11 without the line. /api/v1/i18n/locales is unchanged; the organisation default-language setting keeps the app's list. Clause-②: yes (widening): the @object-ui/i18n context gains appContentLanguages and one i18n key, nothing removed. The seat's declaration-face L2 at TIER_DEFAULT read PASS on 59b07447 (this head), record 7061490361, three nits. L1-a ACCEPT 7061448231 on the same head. check-governed-merges --pr 36040 reads NOT governed (+385/−197). landing-k was not needed: the seat read K by hand, 6 since the merge base, under 15, and main since then touches neither translations/ nor skills/. On this head, 45 check-runs are success, 13 are skipped and none failed; mergeable clean. The nits stay unpushed so CI does not run again: stale comments in useUserLocale.ts and provider.tsx (L2 1–2, L1-a N1), and the hint is read as part of the language name by screen readers (L2 3). An account with a saved language still uses it after sign-in (#30399), which the ruling does not change; the German phone menu overflow is #36041. The seat readies this PR and arms auto-merge in the same step. The PR carries Fixes #35425.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

应用内语言菜单只有 4 种,登录页能选的更多:两处统一成同一份清单

2 participants